#include<bits/stdc++.h>
using namespace std;

int n,ans;
int r[100005];
int tn[100005];

int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	ans=n;
	for(int i=1;i<=n;i++)cin>>r[i];
	sort(r+1,r+n+1);
	int pre=0;
	int num=0;
	r[n+1]=1e6;
	for(int i=1;i<=n+1;i++)
	{
		if(r[i]>pre)
		{
			pre=r[i];
			num++;
			if(num>=3)ans-=min(tn[num-1],tn[num-2]);
		}
		tn[num]++;
	}
	cout<<ans<<endl;
	return 0;
}
